package com.financialsharing.service.impl;

import com.financialsharing.dao.ExperimentMapper;
import com.financialsharing.pojo.experiment.Experiment;
import com.financialsharing.pojo.experiment.ExperimentReportVo;
import com.financialsharing.service.ExperimentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author lvyongwei
 */
@Service
public class ExperimentServiceImpl implements ExperimentService {

    @Autowired
    private ExperimentMapper experimentMapper;

    /**
     * 添加实验报告
     * @param experiment
     * @return
     */
    @Override
    public boolean insertExperiment(Experiment experiment) {
        return experimentMapper.insertExperiment(experiment);
    }

    /**
     * 修改实验报告
     * @param experiment
     * @return
     */
    @Override
    public boolean updateExperiment(Experiment experiment) {
        return experimentMapper.updateExperiment(experiment);
    }

    /**
     * 获取实验报告列表
     * @param userId
     * @param message 关键字
     * @return
     */
    @Override
    public List<ExperimentReportVo> getAllReport(Integer userId, String message) {
        return experimentMapper.getAllReport(userId,message);
    }
}
